'use strict';

/**
 * @param {Egg.Application} app - egg application
 */


module.exports = app => {
  const { router, controller } = app;

  // router.get('/api/getWYLuser', controller.user.index);
  // router.post('/api/addWYLuser', controller.user.create); // 创建
  // router.delete('/api/delWYLuser/:id', controller.user.destroy); // 删除
  // router.put('/api/upWYLuser/:id', controller.user.update); // 更新
  // router.get('/api/getWYLuser2/:id', controller.user.show); // 查找
  // router.get('/api/getWYLuser23/:age', controller.user.index0); // 查找

  // 消息设置
  router.get('/api/mjtmessage', controller.mjtmessage.index);
  router.put('/api/mjtmessage/:id', controller.mjtmessage.update);
  // 自动回复
  router.get('/api/mjtreply', controller.mjtreply.index);
  router.put('/api/mjtreply/:id', controller.mjtreply.update);
  // 系统权限
  router.get('/api/mjtsystem', controller.mjtsystem.index);
  router.put('/api/mjtsystem/:id', controller.mjtsystem.update);
  // 我的(主页渲染)
  router.post('/api/mjttcyg', controller.mjttcyg.create);
  router.get('/api/mjttcyg/:userId', controller.mjttcyg.index0);
  router.put('/api/mjttcyg/:id', controller.mjttcyg.update);
  // 我的(主页渲染) 我卖的
  router.get('/api/mjtisell/:userId', controller.mjtisell.index0);
  router.post('/api/mjtisell', controller.mjtisell.create);
  // 我的(详情页) 评论
  router.get('/api/mjtcomment/:userId', controller.mjtcomment.index0);
  // 我的(主页渲染) 我买的
  router.get('/api/mjtiboughtit', controller.mjtiboughtit.index);
  router.get('/api/mjtiboughtit/shopstate/:shopState', controller.mjtiboughtit.index0);
  router.get('/api/mjtiboughtit/userId/:userId', controller.mjtiboughtit.index00);
  router.put('/api/mjtiboughtit/:id', controller.mjtiboughtit.update);
  // 别人(主页渲染) 下面选项
  router.get('/api/mjtother/:userId', controller.mjtother.index0);

  router.get('/api/lfygoods', controller.lfygoods.index);
  router.get('/api/lfygoods/:id', controller.lfygoods.show); // 查找
  router.get('/api/lfymessage', controller.lfymessage.index);
  router.get('/api/lfytopic', controller.lfytopic.index);
  router.post('/api/lfytopic', controller.lfytopic.create);
  router.get('/api/lfytopic/:id', controller.lfytopic.show); // 查找
  router.get('/api/lfypublic', controller.lfypublic.index);
  router.get('/api/lfypublic/:id', controller.lfypublic.show); // 查找
  router.get('/api/lfynewsmess', controller.lfynewsmess.index);
  router.post('/api/addlfymess', controller.lfynewsmess.create); // 创建

  router.put('/api/lfygoodsup/:id', controller.lfygoods.update); // 淘货-点赞

  // 淘货-详情
  router.get('/api/searchlfymess/:judge', controller.lfymessage.index0); // 评论
  router.put('/api/lfygoods/:id', controller.lfygoods.update); // 关注
  router.put('/api/lfymessage/:id', controller.lfymessage.update); // 评论点赞
  router.post('/api/lfymessage', controller.lfymessage.create); // 发布评论

  router.put('/api/lfytopicup/:id', controller.lfytopic.update); // 话题-点赞

  // 话题-详情
  router.put('/api/lfytopic/:id', controller.lfytopic.update); // 关注
  router.put('/api/lfyTmessage/:id', controller.lfymessage.update); // 评论点赞
  router.post('/api/lfyTmessage', controller.lfymessage.create); // 发布评论

  router.put('/api/lfypublicup/:id', controller.lfypublic.update); // 公益-点赞

  // 公益-新闻-详情
  router.put('/api/lfyPmessage/:id', controller.lfynewsmess.update); // 评论点赞

  router.get('/api/psxcation', controller.psxcation.index);// 获取宝贝分类数据
  router.get('/api/psxnews', controller.psxnews.index);// 获取广场消息
  router.get('/api/psxcontacts', controller.psxcontacts.index);// 获取消息的交易数据
  router.post('/api/addpsxidle', controller.psxidle.create); // 创建发布闲置
  router.post('/api/addpsxtopic', controller.psxtopic.create); // 创建发布话题
  router.post('/api/psxloadimg', controller.psxupload.updatepuSubPic);// 上传图片

  router.post('/api/addUser', controller.whjregister.create);
  router.get('/api/getuser', controller.whjregister.index);
  router.get('/api/getusers/:username', controller.whjregister.index0); // 查找
  router.put('/api/whjregister/:id', controller.whjregister.update); // 更新密码
  router.post('/api/login', controller.login.login); // 查找
  router.get('/api/getshopList', controller.whjshoplist.index);
  router.get('/api/getfenlei', controller.whjfenlei.index);
  router.get('/api/getshop/:id', controller.whjshoplist.show); // 查找
  router.get('/api/searchshop/:search', controller.whjshoplist.index0); // 查找

  router.get('/api/getmessage', controller.whjmessage.index);
  router.put('/api/upshopList/:id', controller.whjshoplist.update);
  router.put('/api/upmess/:id', controller.whjmessage.update);
  router.post('/api/addmess', controller.whjmessage.create);
  router.get('/api/sefenlei/:id', controller.whjfenlei.show); // 查找
  router.get('/api/gettage', controller.whjtage.index);
  router.get('/api/gettopic', controller.whjtopic.index);
  router.get('/api/gettopic/:id', controller.whjtopic.show); // 查找

  router.get('/api/searchmess/:judge', controller.whjmessage.index0); // 查找
};

